#include <iostream>

std::string 
censor_string1(std::string text, const std::string& remove)
{
  std::size_t pos = 0;
  std::size_t found;
  std::string res;

  for (std::size_t i = 0; i < text.size(); ++i)
    {
      if (remove.find(text[i]) == std::string::npos)
	{
	  res += text[i];
	}
    }

  return res;
}

void 
censor_string2(std::string& text, const std::string& remove)
{
  std::size_t i = 0;
  while (i < text.length())
    {
      if (remove.find(text[i]) != std::string::npos)
	{
	  text.erase(i, 1);
	}
      else
	{
	  ++i;
	}
    }
}


int main()
{
  std::string original_string = "Stanford University";
  std::string remove_pattern = "nt";

  /*std::cout << "Enter a string: ";
  std::cin >> original_string;
  std::cout << "Enter the remove pattern: ";
  std::cin >> remove_pattern;*/

  std::string result = censor_string1(original_string, remove_pattern);
  std::cout << "Remove with censor_string1. result = " << result << std::endl;

  censor_string2(original_string, remove_pattern);
  std::cout << "Remove with censor_string2. result = " << original_string << std::endl;
}
